<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
    	<!-- 公共头部，必须引用 -->
        <meta charset="utf-8">
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta content="width=device-width, minimum-scale=1,initial-scale=1, maximum-scale=1, user-scalable=1" id="viewport" name="viewport" />
		<meta content="yes" name="apple-mobile-web-app-capable" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style" />
		<meta content="telephone=no" name="format-detection" />
		<link type="text/css" rel="stylesheet" href="../../template/css/com/com.css"/>
		<link type="text/css" rel="stylesheet" href="../../template/css/list/style.css"/>

		<script src="../../template/js/jquery.js"></script>
		<script src="../../template/js/com/com.js"></script>
		<script src="../../template/js/com/template.js"></script>
		<script src="../../resource/my.js"></script>
		<script src="../../script/api.js"></script>
		<script type="text/javascript" src="../../script/constants.js"></script>
        <link rel="stylesheet" href="../../resource/weuimin.css" />
		<link rel="stylesheet" href="../../resource/example.css" />
        <link rel="stylesheet" href="../../resource/jinsuistyle.css" />
        <script type="text/javascript" src="../../script/aes.js"></script>
	    <script type="text/javascript" charset="UTF-8" src="../../script/naes.js"></script>
	    <script type="text/javascript" src="../../script/modeecb.js"></script>
        <script type="text/javascript" src="../../script/tmd5.js"></script>
        <script type="text/javascript">
            var data="";
            var menus = "";
            var qdm = "";
		    var xpage = 1;
		    var apage = 1;
            apiready=function(){
            var YHDJ = $api.getStorage("YHDJ");
            if (YHDJ == null || YHDJ == '' || YHDJ == 'undefined' || typeof(YHDJ) == "undefined") {
          	$("#jstitle").text("职场生活(平台会员)");
            }else{
             $("#jstitle").text("职场生活("+YHDJ+")");
            }
            
              if(api.systemType == "ios"){
				   document.getElementById("statusBar").style.background = "#298cb4";
				}
              $api.fixStatusBar( $api.dom('header') );
              var header = $api.byId('jsheader');
              if(api.systemType=='ios'){
          			$api.fixIos7Bar(header);
          		}
            api.addEventListener({
			    name: 'close'
			}, function(ret, err) {
			    if(ret.value.key==1){
			       api.closeWin();
			    }
			});
			   $("#loadingToast").show();
               var dm = api.pageParam.dm;
			   var mc = api.pageParam.mc;
		
			   //$("#title").html(mc);
			   if("1" == dm){
			        $("#loadingToast").hide();
			        $("#title").html("进口商品");
			        var lis = "<div class=\"cmenu\">";
        			lis += "<a href=\"javascript:void(0)\" class=\"test menuSelected\" onclick=\"milk()\"><span>奶粉</span></a>";
		     		lis += "</div>";
		     		$("#leftMenu").html(lis);
		     		
		     		var html ="<a href=\"javaScript:void(0)\" class=\"\">"
					+"<table width=\"100%\"><tr>"
					+"<td rowspan=\"2\" valign=\"top\">"
				    +"<div class=\"img80\">"
					+"<img style=\"\" src=\"../../image/1d.jpg\" onclick=\"\"/>"
					+"</div></td>"
					+"<td><span class=\"name\" onclick=\"milk()\">Nutrilon奶粉";
                    html += "</span> </td>"
					+"<td rowspan=\"2\" width=\"10%\">"
					+"<input type=\"button\" class=\"pxui-light-button addtocart\" style=\"width:40px;padding:5px;\" id=\"xgButton\""
					+"value=\"选购\" onclick=\"milk()\"/>"
					+"</td>"
					+"</tr><tr>"
					+"<td style=\"padding-left:12px;\"><span class=\"price\"></span>&nbsp;&nbsp;原装进口 海关监管 荷兰TNT邮政直邮</td>"
					+"</tr></table></a>";
					
						$("#main_menu").html(html);
			   }else{
			   $("#topPic").attr("src","../../image/"+ dm + ".jpg");
               var callback = function(ret, err){
				    $("#loadingToast").hide();
				    console.log(JSON.stringify(ret));
	                if (ret) {
	                      data = eval("("+ ret.json +")");
	                      
	                      var lis = "";
	                      show(data[0].ddm,data[0].dmc); 
	                      menus = data;
	                       api.ajax({
						        url: url.zcflurl,
						        method: 'post',
						        data:{ 
							            values: {dm:data[0].ddm}
							        }
					        },function(dt,err){
					                console.log(JSON.stringify(dt));
					            	if (dt) {
					        			var dd = eval("("+ dt.json +")");
					        			//lis += "<li><img src=\"http://ypt.blob.core.chinacloudapi.cn/picture/app/icon/"+ menus[0].ddm + ".jpg\" onclick=\"show('"+ menus[0].ddm + "','"+ menus[0].dmc + "',this)\" width=\"100%\"/></li>";
					        			lis += "<div class=\"cmenu\">";
					        			lis += "<a href=\"javascript:void(0)\" class=\"test menuSelected\" onclick=\"xjshow(1,'" + dd[0].ddm +"',this)\"><span>"+ dd[0].dmc + "</span></a>";
					        			for(var j=1;j<dd.length;j++){
						     				lis += "<a href=\"javascript:void(0)\" class=\"test\" onclick=\"xjshow(1,'" + dd[j].ddm +"',this)\"><span>"+ dd[j].dmc + "</span></a>";
							     		}	
							     		lis += "</div>";
							     		 for(var i=1;i<menus.length;i++){
							     		 	lis += "<li><img src=\"http://mobile-1255508964.file.myqcloud.com/app/icon/"+ menus[i].ddm + "_dis.jpg\" onclick=\"reloadMenus('"+ menus[i].ddm + "','"+ menus[i].dmc + "')\" width=\"100%\"/></li>";
							     		 }
					        		}
					        		
					        		$("#leftMenu").html(lis);
					        });
				    } else {
				        api.alert({ msg: "网络异常！" });
				    }
			   }
			   var content = {"dm":dm};
			   apiAjax(JSON.stringify(content),url.zcflurl,callback);
			   }
         }
         
         function milk(){
            var jp = $api.getStorage("dl_phone");
            var YHDJ = $api.getStorage("YHDJ");
            var level = 0;
            if(YHDJ=="白银会员"){
             level = 1;
            }else if(YHDJ=="黄金会员"){
             level = 2;
            }else if(YHDJ=="铂金会员"){
             level = 3;
            }else if(YHDJ=="钻石会员"){
             level = 4;
            }
				if(jp==null||jp==''||typeof(jp)==undefined||jp=='undefined'){
					api.alert({
						msg:'请登录'
			        },function(ret,err){
			        	api.openWin({
				            name: 'login',
				            url: '../login.html'
			            });
			        });
            }else{
                api.openFrame({
				    name: 'milk',
				    url: 'http://119.28.176.231/oneLogin.jsp?type=2&source=488d34e32e6d29e550b9e461cc631786&uid='+jp+'&level='+level,
				    rect: {
				        x: 0,
				        y: 70,
				        w: 'auto',
				        h: 'auto'
				    },
                    progress: {
			            type: "default",                //加载进度效果类型，默认值为 default，取值范围为 default|page，default 等同于 showProgress 参数效果；为 page 时，进度效果为仿浏览器类型，固定在页面的顶部
			            title: "",               //type 为 default 时显示的加载框标题
			            text: "加载中...",                //type 为 default 时显示的加载框内容
			            color: "#45C01A"                //type 为 page 时进度条的颜色，默认值为 #45C01A，支持#FFF，#FFFFFF，rgb(255,255,255)，rgba(255,255,255,1.0)等格式
			          }
				});
		    }
         }
         
         function reloadMenus(dm,mc){
         	$("#title").html(mc);
         	var lis = "";
         	api.ajax({
		        url: url.zcflurl,
		        method: 'post',
		        data:{ 
			            values: {dm:dm}
			        }
	        },function(dt,err){
	        	if(dt){
	        	//console.log(JSON.stringify(dt));
	        		var dd = eval("("+ dt.json +")");
		         	for(var i=0;i<menus.length;i++){
		         		if(dm == menus[i].ddm){
		         			lis += "<div class=\"cmenu\">";
		         			xjshow(1,dd[0].ddm);
		         			lis += "<a href=\"javascript:void(0)\" class=\"test menuSelected\" onclick=\"xjshow(1,'" + dd[0].ddm +"',this)\"><sapn>"+ dd[0].dmc + "</sapn></a>";
		         			for(var j=1;j<dd.length;j++){
		        				lis += "<a href=\"javascript:void(0)\" class=\"test\" onclick=\"xjshow(1,'" + dd[j].ddm +"',this)\"><sapn>"+ dd[j].dmc + "</sapn></a>";
				     		}	
				     		lis += "</div>";
		         		}else{
			     		 	lis += "<li><img src=\"http://mobile-1255508964.file.myqcloud.com/app/icon/"+ menus[i].ddm + "_dis.jpg\" onclick=\"reloadMenus('"+ menus[i].ddm + "','"+ menus[i].dmc + "')\" width=\"100%\"/></li>";
		         		}
		     		 }
		     		$("#leftMenu").html(lis);
	         	}
         	});
         }
         
         

     	function show(dm,mc,e){
     		if(e != null){
     			var imgs = $("#leftMenu img");
	     		for(var i=0;i<imgs.length;i++){
		     		if(imgs[i].src.indexOf("_dis")== -1){
		     			imgs[i].src=imgs[i].src.replace(".jpg","_dis.jpg")
		     		}
	     		}
	     		//e.src = e.src.replace("_dis","");
     		}
     		
     	    $("#loadingToast").show();
     		$("#title").html(mc);
     		  var callback = function(ret, err){
				    $("#loadingToast").hide();
	        		if (ret) {
	        		  data = eval("("+ ret.json +")");
                       var html ="";
			     		$("#main_menu").html(html);
			     		xjshow(1,data[0].ddm);
			     		
			     		for(var i=0;i<data.length;i++){
			     				html += "<a href=\"javascript:void(0)\" class=\"test\" onclick=\"xjshow(1,'" + data[i].ddm +"')\"><sapn>"+ data[i].dmc + "</sapn></a>";
									//html += ("<a href=\"javascript:void(0)\" onclick=\"xjshow('" + data[i].ddm +"')\"><span class=\"pxui-light-button\">"+ data[i].dmc + "</span></a>");
				     		}	
			     			//$("#stiles").html(html);
			     		
//			     		if(data.length!=1){
//				     		for(var i=0;i<data.length;i++){
//									html += ("<a class=\"weui-grid \" href=\"javascript:void(0)\" onclick=\"showList('" + data[i].ddm +"','"+data[i].dmc+"',"+i+")\">"
//											+"<img style=\"width:100%;height:100px;\" src=\"http://ypt.blob.core.chinacloudapi.cn/picture/app/icon/" + data[i].ddm + ".jpg\" />"
//											+"<p class=\"weui-grid-label\"><font>"+ data[i].dmc + "</font></p></a>");
//				     				
//				     			 
//				     		}
//								$("#main_menu").html(html);
//			     		}else{
//			     		 
//			     		}
			     		
			     		$api.setStorage('spxx',data);	
			     		//return html; 
                      }
			   }
			   var content = {"dm":dm};
			   apiAjax(JSON.stringify(content),url.zcflurl,callback);
     	}



     function xjshow(page,dm,e){
            qdm = dm;
            xpage = parseInt(page);
            var YHDJ = $api.getStorage("YHDJ");
     		if(e != null){
     			$(".test").removeClass("menuSelected");
     			e.className = "test menuSelected";
     		}
            $("#loadingToast").show();
            var callback = function(ret, err){
            	 //console.log(JSON.stringify(ret));
               $("#loadingToast").hide();
	        	 data1 = eval("("+ ret.json +")");
	        	   var html ="";
	        	   var className = "";
	        	    var kc = "";
	        	 $("#main_menu").html(html);
	        	 apage = data1.ys;
	        	 $("#span_all").html(page + "/" + data1.ys);
	        	
	        	 for(var i=0;i<data1.sps.length;i++){
	        	  var khdj=YHDJ;//新增
		        	 var dj ;
		        	 if(khdj == "白银会员"){
		        	 if(data1.sps[i].zka=="undefined"||typeof(data1.sps[i].zka)=="undefined"){
		        	 	dj = 0;
		        	 	}else{
		        	 	dj = data1.sps[i].zka*0.1;
		        	 	}
		        	 }else if(khdj == "黄金会员"){
		        	 	if(data1.sps[i].zkb=="undefined"||typeof(data1.sps[i].zkb)=="undefined"){
		        	 	dj = 0;
		        	 	}else{
		        	 	dj = data1.sps[i].zkb*0.1;
		        	 	}
		        	 }else if(khdj == "铂金会员"){
		        	 if(data1.sps[i].zkc=="undefined"||typeof(data1.sps[i].zkc)=="undefined"){
		        	 	dj = 0;
		        	 	}else{
		        	 	dj = data1.sps[i].zkc*0.1;
		        	 	}
		        	 }else if(khdj == "钻石会员"){
		        	 	if(data1.sps[i].zkd=="undefined"||typeof(data1.sps[i].zkd)=="undefined"){
		        	 	dj = 0;
		        	 	}else{
		        	 	dj = data1.sps[i].zkd*0.1;
		        	 	}
		        	 }else{
		        	 	dj = 0;
		        	 }
		        	
			        	//1==1的位置应该是判断客户是否为等级客户
					html +="<a href=\"javaScript:void(0)\" class=\""+ className + "\">"
					+"<table width=\"100%\"><tr>"
					+"<td rowspan=\"2\" valign=\"top\">"
				    +"<div class=\"img80\">"
					+"<img style=\"\" src=\""+ data1.sps[i].pic +"\" onclick=\"xjshowList('" + data1.sps[i].dm + "\')\"/><br>"
					+"</div></td>"
					
					+"<td>";
					
					html +="<span class=\"name\" onclick=\"xjshowList('" + data1.sps[i].dm + "\')\">"
					if(dj!=0){

					html += "<strong style=\"font-size: 16px;font-weight: bold;\"> ✱ </strong>"
		        	 }
					html +=(data1.sps[i].mc);
					if(data1.sps[i].kc == 0){
					  html += "(无货)";
					} 
                    html += "</span> </td>"
//					+"<td rowspan=\"2\" width=\"10%\">"
//					+"<input type=\"button\" class=\"pxui-light-button addtocart\" style=\"width:40px;padding:5px;\" id=\"xgButton\""
//					+"value=\"选购\" onclick=\"subtj('"+ data1.sps[i].mc + "','" ;
//					if(dj!=""){
//					html += parseFloat(data1.sps[i].price)*parseFloat(dj);
//					}else{
//					html += data1.sps[i].price
//					}
//					
//					html += "','1','"+ data1.sps[i].dm+"',"+data1.sps[i].kc+") \"/>"
//					+"</td>"
					+"</tr><tr>"
					+"<td style=\"padding-left:12px;\"><span class=\"price\">原价：￥"+data1.sps[i].price+"</span> <br>";
					if(dj!=0){
					
//					html +="<span class=\"price\" style=\"color:red\">折扣:"+(dj*10).toFixed(1)+"折</span> <br>";
//					html +="<span class=\"price\" style=\"color:red\">省:"+(parseFloat(data1.sps[i].price)-parseFloat(data1.sps[i].price)*parseFloat(dj)).toFixed(2)+"元</span> <br>";
		        	 html +="<span class=\"price\" style=\"font-weight:bold;\">折扣价：￥"+(parseFloat(data1.sps[i].price)*parseFloat(dj)).toFixed(2)+"</span>";
		        	 }
					html +="&nbsp;&nbsp;(四川省内包邮，省外另加邮费12元)</td>"
					+"</tr></table></a>";
						$("#main_menu").html(html);
				     				
	        	}
		    }
		   
		    var content = {"dm":dm,"page":page};
		    apiAjax(JSON.stringify(content),url.zcxjurl,callback);
        }
        function showList(dm,dmc,i){
        	api.openWin({
			    name: 'list',
			    url: './list.html',
			    pageParam: {
			        qdm: dm,
			        dmc: dmc,
			        i: i
			    }
			});
        }
        
         function xjshowList(dm){
        	api.openWin({
			     name: 'detail',
				    url: './detail.html',
				    pageParam: {
				        spdm: dm
				    }			
			});
        }

function subtj(spmc,price,sl,dm,kc){
 		//console.info(spmc+","+price+","+sl+","+dm);
 		if(kc == 0){
 		   api.toast({
	        msg:"暂无库存，请选购其他商品"
          });
          return;
 		}
 		var product =
	        {
              'dm':dm,       //属性名用引号括起来，属性间由逗号隔开
              'spmc': spmc,
              'sl':sl,
              'price':price
	        };
	     	  cart.addproduct(product);
	    api.toast({
	        msg:spmc+"已添加到购物筐"
        });
 	}

 utils = {
		    setParam : function (name,value){
		        localStorage.setItem(name,value)
		    },
		    getParam : function(name){
		        return localStorage.getItem(name)
		    }
		}

            cart = {
			    //向购物车中添加商品
			    addproduct:function(product){
			        var ShoppingCart = utils.getParam("ShoppingCart");
			        if(ShoppingCart==null||ShoppingCart==""){
			                        //第一次加入商品
			                        console.log(product.price*product.sl);
			            var jsonstr = {"productlist":[{"dm":product.dm,"spmc":product.spmc,"sl":product.sl,"price":product.price}],"totalNumber":product.sl,"totalAmount":(product.price*product.sl)};
			            utils.setParam("ShoppingCart",JSON.stringify(jsonstr));
			        }else{
			            var jsonstr = JSON.parse(ShoppingCart);
			            var productlist = jsonstr.productlist;
			            var result=false;
			            //查找购物车中是否有该商品
			            for(var i=0;i<productlist.length;i++){
			                if(productlist[i].dm==product.dm){
			                    productlist[i].sl=parseInt(productlist[i].sl)+parseInt(product.sl);
			                    result = true;
			                }
			            }
			            if(!result){
			                //没有该商品就直接加进去
			                productlist.push({"dm":product.dm,"spmc":product.spmc,"sl":product.sl,"price":product.price});
			            }
			                        //重新计算总价
			            jsonstr.totalNumber=parseInt(jsonstr.totalNumber)+parseInt(product.sl);
			//          jsonstr.totalAmount=parseFloat(jsonstr.totalAmount)+(parseInt(product.num)*parseFloat(product.price));
			            console.log(jsonstr.totalAmount);
			            jsonstr.totalAmount=accAdd(jsonstr.totalAmount, product.sl*product.price);
			            console.log(jsonstr.totalAmount);
			            orderdetail.totalNumber = jsonstr.totalNumber;
			            orderdetail.totalAmount = jsonstr.totalAmount;
			            //保存购物车
			            utils.setParam("ShoppingCart",JSON.stringify(jsonstr));
			        }
			    },

			    //修改给买商品数量
			    updateproductnum:function(dm,num){
			        var ShoppingCart = utils.getParam("ShoppingCart");
			        var jsonstr = JSON.parse(ShoppingCart.substr(1,ShoppingCart.length));
			        var productlist = jsonstr.productlist;

			        for(var i=0;i<productlist.length;i++){
			            if(productlist[i].dm==dm){
			                jsonstr.totalNumber=parseInt(jsonstr.totalNumber)+(parseInt(num)-parseInt(productlist[i].sl));
			//              jsonstr.totalAmount=parseFloat(jsonstr.totalAmount)+((parseInt(num)*parseFloat(productlist[i].price))-parseInt(productlist[i].num)*parseFloat(productlist[i].price));
			                jsonstr.totalAmount=accAdd(jsonstr.totalAmount, accSub(num*productlist[i].price, productlist[i].sl*productlist[i].price));
			                productlist[i].sl=parseInt(num);

			                orderdetail.totalNumber = jsonstr.totalNumber;
			                orderdetail.totalAmount = jsonstr.totalAmount;
			                utils.setParam("ShoppingCart","'"+JSON.stringify(jsonstr));
			                return;
			            }
			        }
			    },

			    //获取购物车中的所有商品
			    getproductlist:function(){
			        var ShoppingCart = utils.getParam("ShoppingCart");
			        if (!ShoppingCart) {
			                return null;
			        }
			        var jsonstr = JSON.parse(ShoppingCart.substr(1,ShoppingCart.length));
			        var productlist = jsonstr.productlist;
			        orderdetail.totalNumber = jsonstr.totalNumber;
			        orderdetail.totalAmount = jsonstr.totalAmount;
			        return productlist;
			    },

			    //获取整个购物车
			    getshopcart:function(){
			            var ShoppingCart = utils.getParam("ShoppingCart");
			            return ShoppingCart;
			    },

			    //判断购物车中是否存在商品
			    existproduct:function(id){
			        var ShoppingCart = utils.getParam("ShoppingCart");
			        var jsonstr = JSON.parse(ShoppingCart.substr(1,ShoppingCart.length));
			        var productlist = jsonstr.productlist;
			        var result=false;
			        for(var i=0;i<productlist.length;i++){
			            if(productlist[i].dm==dm){
			                result = true;
			            }
			        }
			        return result;
			    },

			    // 通过id获取商品
			    getproductbyid:function(id) {
			            var ShoppingCart = utils.getParam("ShoppingCart");
			        var jsonstr = JSON.parse(ShoppingCart.substr(1,ShoppingCart.length));
			        var productlist = jsonstr.productlist;
			        var result=false;
			        for(var i=0;i<productlist.length;i++){
			            if(productlist[i].dm==dm){
			                return productlist[i];
			            }
			        }
			        return null;
			    },
			    //删除购物车中商品
			    deleteproduct:function(id){
			        var ShoppingCart = utils.getParam("ShoppingCart");
			        var jsonstr = JSON.parse(ShoppingCart.substr(1,ShoppingCart.length));
			        var productlist = jsonstr.productlist;
			        var list=[];
			        for(var i=0;i<productlist.length;i++){
			            if(productlist[i].dm==id){
			                jsonstr.totalNumber=parseInt(jsonstr.totalNumber)-parseInt(productlist[i].sl);
			//              jsonstr.totalAmount=parseFloat(jsonstr.totalAmount)-parseInt(productlist[i].num)*parseFloat(productlist[i].price);
			                jsonstr.totalAmount=accSub(jsonstr.totalAmount, productlist[i].sl*productlist[i].price);
			            }else{
			                list.push(productlist[i]);
			            }
			        }
			        jsonstr.productlist = list;
			        orderdetail.totalNumber = jsonstr.totalNumber;
			        orderdetail.totalAmount = jsonstr.totalAmount;
			        utils.setParam("ShoppingCart","'"+JSON.stringify(jsonstr));
			    },
			    //清空购物车
			    clear:function(){
			            utils.setParam("ShoppingCart", "");
			    }
			};

             function accAdd(num1, num2) {
			        var r1, r2, m;
			        try {
			                r1 = num1.toString().split('.')[1].length;
			        } catch(e) {
			                r1 = 0;
			        }
			        try {
			                r2 = num2.toString().split(".")[1].length;
			        } catch(e) {
			                r2 = 0;
			        }
			        m = Math.pow(10, Math.max(r1, r2));
			        // return (num1*m+num2*m)/m;
			        return Math.round(num1 * m + num2 * m) / m;
			}

			// 两个浮点数相减
			function accSub(num1, num2) {
			        var r1, r2, m;
			        try {
			                r1 = num1.toString().split('.')[1].length;
			        } catch(e) {
			                r1 = 0;
			        }
			        try {
			                r2 = num2.toString().split(".")[1].length;
			        } catch(e) {
			                r2 = 0;
			        }
			        m = Math.pow(10, Math.max(r1, r2));
			        n = (r1 >= r2) ? r1 : r2;
			        return (Math.round(num1 * m - num2 * m) / m).toFixed(n);
			}

			// 两数相除
			function accDiv(num1, num2) {
			        var t1, t2, r1, r2;
			        try {
			                t1 = num1.toString().split('.')[1].length;
			        } catch(e) {
			                t1 = 0;
			        }
			        try {
			                t2 = num2.toString().split(".")[1].length;
			        } catch(e) {
			                t2 = 0;
			        }
			        r1 = Number(num1.toString().replace(".", ""));
			        r2 = Number(num2.toString().replace(".", ""));
			        return (r1 / r2) * Math.pow(10, t2 - t1);
			}

			// 浮点数相乘
			function accMul(num1, num2) {
			        var m = 0, s1 = num1.toString(), s2 = num2.toString();
			        try {
			                m += s1.split(".")[1].length
			        } catch(e) {
			        };
			        try {
			                m += s2.split(".")[1].length
			        } catch(e) {
			        };
			        return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m);
			}

        orderdetail={
			  //  username:"",
			  //  phone:"",
			  //  address:"",
			  //  zipcode:"",
			    totalNumber:0,
			    totalAmount:0.00
			}

        function jpage(e){
    		if(e == 'a'){
    			if( xpage > 1){
	        		xpage = xpage-1;
	        		xjshow(xpage,qdm,this);
    			}
    		}
    		if(e == 'b' ){
    			if(xpage < apage){
	        		xpage = xpage+1;
	        		xjshow(xpage,qdm,this);
    			}
    		}
    	}

        function closeWin(){
         api.closeWin();
        }

        function reMain(){

        }

        function goMain(){
          api.closeWin();
        }
        
        function goHistory(){
			var jp = $api.getStorage("dl_phone");
				if(jp==null||jp==''||typeof(jp)==undefined||jp=='undefined'){
					api.alert({
						msg:'请登录'
			        },function(ret,err){
			        	api.openWin({
				            name: '跳转登陆',
				            url: '../login.html'
				            //url:'html/jskp/jskp.html'
			            });
			        });
				}else{
					api.openWin({
					    name: 'history.html',
					    url: 'history.html'
					    //url:'html/jskp/jskp.html'
					});
				}
			}
			
			function goBill(){
			var jp = $api.getStorage("dl_phone");
				if(jp==null||jp==''||typeof(jp)==undefined||jp=='undefined'){
					api.alert({
						msg:'请登录'
			        },function(ret,err){
			        	api.openWin({
				            name: '跳转登陆',
				            url: '../login.html'
				            //url:'html/jskp/jskp.html'
			            });
			        });
				}else{
					api.openWin({
					    name: 'bill.html',
					    url: 'bill.html'
					    //url:'html/jskp/jskp.html'
					});
				}
			}
        </script>
        <style type="text/css">
         .com-footer-area {padding-top:0px;position:fixed;bottom:0;}
        .com-footer-area  img{height:auto;width:100%;} 
        	.weui-grid{width:50%;padding:2%;}
        	.weui-grid-main{text-align: center;}
        	.weui-grid__icon{width:70px;height:70px;}
        	.weui-grid-main1{
	        	height: 100px;
	        	line-height:100px;
	        	text-align: center;
	        	font-size:16px;
	        	font-weight:bold;
	        	color:#f7f6f6;
	        	background: #FFFFFF url('../../resource/images/main_bg.png') no-repeat 36px 0px ;
        	}
        	.weui-grid-label{
	        	/* height: 100px;
	        	font-size:16px;
	        	font-weight:bold;
	        	color:#FFFFA9;
	        	text-align: center;
	        	text-shadow: #171616 0 1px 0;
	        	background: #FFFFFF url('../../resource/images/menu_bg.png') no-repeat 50% 0px ; */
	        }
	        .weui-grid {display: table;}
	        .weui-grid-label{width: 100px;margin: 0 auto;text-align: center;}
		   /*  .weui-grid-label font {
		    			    width: 100px;
		    			    line-height:22px;
		    			    padding: 0 10px;
		    			    height: 100px;
		    			    word-break: break-all;
		    			    text-align: center;
		    			    vertical-align: middle;
		    			    margin: 0 auto;
		    			    word-wrap: break-word;
		    			    display: table-cell;
		    			} */
        	.isnew{background: #FFFFFF url('../../template/images/xp4.png') no-repeat 100% 0px ;}
        	.weui-grid:after,.weui-grid:before{border-width:0px;}
        	.img80 img{height:100px;}
        	.img20 img{height:20px;}
        	.stiles{margin:5px;}
        	#stiles span{padding:10px;width:100%;margin:0 10px 5px 0;font-size:16px;text-shadow: #171616 0 1px 0;
				}
			#leftMenu a{width:90%;float:left;padding:5px;text-align: center;font-size:14px;border:1px solid #CDCDCD;}
        	/* #leftMenu a:first-child{background: #005DA9;color:#FFF;} */
        	.cmenu a:last-child{margin-bottom:10px;}
        	.test{background: #FFF;color:#333;}
        	.menuSelected{background: #005DA9;color:#FFF;}
        </style>
    </head>
    <body>
     <header id="statusBar">
      <div id="jsheader">
          <nav id="jsnav">
              <a id="jsleft" tapmode="" onclick="api.closeWin();">
                  <span id="backHome">返回</span>
              </a>
              <div id="jsmiddle">
                  <strong id="jstitle">职场生活</strong>
              </div>
              <a id="jsright">
                <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
              </a>
          </nav>
      </div>
     </header>

	<div class="com-content" style="padding-bottom:0px;margin-bottom: 0px;">
		<!-- <div class="com-header-area" id="js-com-header-area">
			<a href="" class="com-header-logo"
				style="width:100%;color:#FFFFFF;text-align:center;font-size:24px;">职场生活</a>
			<dfn></dfn>
			<div class="clear"></div>
		</div> -->
		    <div class="com-header-area" id="js-com-header-area" style="padding-bottom:0px;margin-bottom: 0px;">
			<!-- <a href="" class="com-header-logo"
				style="width:100%;color:#FFFFFF;text-align:center;font-size:20px;">1职场生活</a> -->
				<img id="topPic" src="../../image/tb-test.jpg" style="width:100%;"/>
				<ul class="menu_ul">
					<a href="main.html" class="selected"><li>首  页</li></a>
					<a onclick="goHistory();"><li>历 史 订 单</li></a>
					<a onclick="goBill();"><li>购 物 筐</li></a>
				</ul>
			<dfn></dfn>
			<div class="clear"></div>
		</div>  
		
		
		
			<!--content-->
			<div class="page-role style-page">
				<!-- <div class="pxui-tab pxui-tab-nav pxui-tab-no-top">
					<a href="main.html"   class="selected"><i></i>首 页<span></span></a>
					<a href="history.html"><i></i>历史订单<span></span></a>
					<a href="bill.html"><i></i>购物筐<span></span></a>
				</div>-->
				<div class="page-title">
					<a href="#" onclick="closeWin();" class="return">返 回</a>
					<b id="title"></b>
				</div>
				
				<div style="min-height:300px;">
							<div style="background-color:#fff;">
								<div style="width:29%;float:left;" id="left_menu">
									<ul id="leftMenu">
										<!-- <li><img src="../../image/rc1.png" onclick="show('5001')" width="100%"/>1</li>
										<li><img src="../../image/zc1.png" onclick="show('5003')" width="100%"/>2</li>
										<li><img src="../../image/cy1.png" onclick="show('5002')" width="100%"/>3</li> -->
									</ul>
								</div>
								
								<div class="weui-grids" style="width:70%;float:right;">
									<!-- <div class="stiles" id="stiles">
										<a href="javascript:void(0)" onclick=""><span class="pxui-light-button">抽纸</span></a>
										<a href="javascript:void(0)" onclick=""><span class="pxui-light-button">卷纸</span></a>
									</div> -->
									<div style="background-color:#fff;">
										<div class="weui-grids" id="main_menu">
										
										<!--<a href="javaScript:void(0)" class=""><table width="100%"><tr><td rowspan="2" valign="top"><div class="img80"><img style="" src="http://market-1255508964.file.myqcloud.com/picture/sjck/qinfgengduanchou8bao.png" onclick="xjshowList('2701T999901306')"/><br></div></td><td><span class="name" onclick="xjshowList('2701T999901306')"><strong style="font-size: 24px;font-weight: bold;"> * </strong>清风短抽纸136mm 8包/提</span> </td></tr><tr><td style="padding-left:12px;"><span class="price">原价：￥18.00 </span> <br><span class="price" style="font-weight:bold;">折扣价：￥14.40</span>&nbsp;&nbsp;(四川省内包邮，省外另加邮费12元)</td></tr></table></a><a href="javaScript:void(0)" class=""><table width="100%"><tr><td rowspan="2" valign="top"><div class="img80"><img style="" src="http://market-1255508964.file.myqcloud.com/picture/zj/120cwdcrcz.png" onclick="xjshowList('2701T999901268')"/><br></div></td><td><span class="name" onclick="xjshowList('2701T999901268')"><strong style="font-size: 24px;font-weight: bold;padding: auto;"> ★ </strong>维达 120抽超韧抽纸V2889</span> </td></tr><tr><td style="padding-left:12px;"><span class="price">原价：￥28.00 </span> <br><span class="price" style="font-weight:bold;">折扣价：￥26.60</span>&nbsp;&nbsp;(四川省内包邮，省外另加邮费12元)</td></tr></table></a><a href="javaScript:void(0)" class=""><table width="100%"><tr><td rowspan="2" valign="top"><div class="img80"><img style="" src="http://market-1255508964.file.myqcloud.com/picture/zj/myxldx.png" onclick="xjshowList('2701T999901265')"/><br></div></td><td><span class="name" onclick="xjshowList('2701T999901265')"><strong style="font-size: 24px;font-weight: bold;"> * </strong>来一卷母婴系列短抽纸 120mm*176mm*320张</span> </td></tr><tr><td style="padding-left:12px;"><span class="price">原价：￥52.00 </span> <br><span class="price" style="font-weight:bold;">折扣价：￥41.60</span>&nbsp;&nbsp;(四川省内包邮，省外另加邮费12元)</td></tr></table></a><a href="javaScript:void(0)" class=""><table width="100%"><tr><td rowspan="2" valign="top"><div class="img80"><img style="" src="http://market-1255508964.file.myqcloud.com/picture/zcsh/ybebscz.png" onclick="xjshowList('2701T999901096')"/><br></div></td><td><span class="name" onclick="xjshowList('2701T999901096')"><strong style="font-size: 24px;font-weight: bold;"> * </strong>耶贝尔白色抽纸 （20包）3层*135抽</span> </td></tr><tr><td style="padding-left:12px;"><span class="price">原价：￥60.00</span> <br><span class="price" style="font-weight:bold;">折扣价：￥48.00</span>&nbsp;&nbsp;(四川省内包邮，省外另加邮费12元)</td></tr></table></a><a href="javaScript:void(0)" class=""><table width="100%"><tr><td rowspan="2" valign="top"><div class="img80"><img style="" src="http://market-1255508964.file.myqcloud.com/picture/zj/sungxlcc.png" onclick="xjshowList('2701T999901266')"/><br></div></td><td><span class="name" onclick="xjshowList('2701T999901266')"><strong style="font-size: 24px;font-weight: bold;"> * </strong>来一卷SNUG系列长抽纸 185mm*190mm*420张</span> </td></tr><tr><td style="padding-left:12px;"><span class="price">原价：￥69.00 </span> <br><span class="price" style="font-weight:bold;">折扣价：￥65.55</span>&nbsp;&nbsp;(四川省内包邮，省外另加邮费12元)</td></tr></table></a><a href="javaScript:void(0)" class=""><table width="100%"><tr><td rowspan="2" valign="top"><div class="img80"><img style="" src="http://market-1255508964.file.myqcloud.com/picture/zcsh/psbszjtz.png" onclick="xjshowList('2701T999901161')"/><br></div></td><td><span class="name" onclick="xjshowList('2701T999901161')"><strong style="font-size: 24px;font-weight: bold;"> * </strong>品胜本色纸 家庭装（抽纸8包+卷纸6卷+方巾纸12包+手帕纸18包）</span> </td></tr><tr><td style="padding-left:12px;"><span class="price">原价：￥79.00</span> <br><span class="price" style="font-weight:bold;">折扣价：￥63.20</span>&nbsp;&nbsp;(四川省内包邮，省外另加邮费12元)</td></tr></table></a><a href="javaScript:void(0)" class=""><table width="100%"><tr><td rowspan="2" valign="top"><div class="img80"><img style="" src="http://market-1255508964.file.myqcloud.com/picture/zcsh/ybebsksscz.png" onclick="xjshowList('2701T999901095')"/><br></div></td><td><span class="name" onclick="xjshowList('2701T999901095')"><strong style="font-size: 24px;font-weight: bold;"> * </strong>耶贝尔白色可湿水抽纸 （20包）3层*135抽</span> </td></tr><tr><td style="padding-left:12px;"><span class="price">原价：￥86.00</span> <br><span class="price" style="font-weight:bold;">折扣价：￥68.80</span>&nbsp;&nbsp;(四川省内包邮，省外另加邮费12元)</td></tr></table></a>
-->
										
										</div>
									</div> 
									<div class="pxui-pages" pageurl="?page=@page" pagesize="5" count=""
									url="" container="#js-goodlist">
									<!-- span><i class="arrow-left"></i>&nbsp;&nbsp;上一页</span-->
									<a href="javaScript:void(0)" onclick="jpage('a')"><i class="arrow-left"></i>&nbsp;&nbsp;上一页</a>
									<div class="pxui-select">
										<span id="span_all">1/0</span>
										<del class="arrow-bottom"></del>
										<select id="span_page">
											<option value="1">1/1</option>
										</select>
								</div>
									<a href="javaScript:void(0)" onclick="jpage('b')">下一页&nbsp;&nbsp;<i class="arrow-right"></i></a>
									<!-- span>下一页&nbsp;&nbsp;<i class="arrow-right"></i></span-->
							</div>
								</div>
							</div>
				</div>
			</div> 
		</div>
		
	</div>
	<!-- 加载动画 -->
	<div id="loadingToast" style="display:none;">
			<div class="weui-mask_transparent"></div>
			<div class="weui-toast">
				<i class="weui-loading weui-icon_toast"></i>
				<p class="weui-toast__content">数据加载中...</p>
			</div>
		</div>
	<!-- 公共底部，必须引用 -->
		
			<!-- <div class="com-footer-area footer" id="js-com-footer" style="width:100%;">
				<img src="../../image/db.png" style="width:100%;">
			</div> -->
		
</body>
</html>
